﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PartiallyApprove.ascx.cs"
    Inherits="Workflow.Alerts.Sublayouts.PartiallyApprove" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<div id="partapprove" runat="server" class="additionPopup">
    <div class="additionPopupLeft floatLeft">
        <div class="rowBoxLabel innerHeader labelPartApprove">Gegevens wijzingen</div>
        <div id="startdate" runat="server" class="boxRow">
            <asp:Label runat="server" ID="label4" AssociatedControlID="rdpStartDate" Text="Start"
                CssClass="labelStart"></asp:Label>
            <telerik:RadDatePicker ID="rdpStartDate" runat="server" EnableEmbeddedBaseStylesheet="False" 
			    EnableEmbeddedSkins="False" Skin="workflow">
			    <ClientEvents OnDateSelected="setMinDate" />			    
                <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">                
                </Calendar>
                <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                <DateInput DisplayDateFormat="d-M-yyyy" DateFormat="d-M-yyyy" AutoPostBack="True">
                </DateInput>
            </telerik:RadDatePicker>
        </div>
        <div id="enddate" runat="server" class="boxRow boxRowGereed">
            <asp:Label runat="server" ID="label1" AssociatedControlID="rdpEndDate" Text="Gereed"
                CssClass="labelGereed"></asp:Label>
            <telerik:RadDatePicker ID="rdpEndDate" runat="server" EnableEmbeddedBaseStylesheet="False" 
			    EnableEmbeddedSkins="False" Skin="workflow">
                <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">
                </Calendar>
                <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                <DateInput DisplayDateFormat="d-M-yyyy" DateFormat="d-M-yyyy" AutoPostBack="True">
                </DateInput>
            </telerik:RadDatePicker>
            <asp:CompareValidator Display="Dynamic" ID="CompareValidator1" runat="server" ErrorMessage="Einddatum kan niet begindatum zijn."
                Operator="GreaterThanEqual" ControlToValidate="rdpEndDate" ControlToCompare="rdpStartDate"
                Type="Date" />
        </div>        
        <div id="traffic" runat="server" class="boxRow" visible="false">
			<div id="trafficproblems" runat="server" class="boxRow">
				<asp:Label runat="server" ID="label3" AssociatedControlID="rblTrafficProblems" Text="Verkeershinder toestaan?"
					CssClass="longLabel floatLeft"></asp:Label>
				<asp:RadioButtonList ID="rblTrafficProblems" runat="server" RepeatDirection="Horizontal"
					CssClass="radioButtonList">
					<asp:ListItem Text="ja" Value="True" class="radioButton"></asp:ListItem>
					<asp:ListItem Text="nee" Value="False" class="radioButton"></asp:ListItem>
				</asp:RadioButtonList>
            </div>
        </div>
    </div>
    <div class="additionPopupRight floatRight">
        <div id="comments" runat="server">
            <asp:Label runat="server" ID="label5" AssociatedControlID="txtComments" Text="Toelichting op het voorbehoud:"
                CssClass="longLabel labelTextarea"></asp:Label><br />
            <asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" CssClass="wide"></asp:TextBox>
            <div class="errorContainer floatLeft">
	            <asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator1" runat="server"
		            ErrorMessage="Vul aub de toelichting in." ControlToValidate="txtComments" />
			</div>
        </div>
        <div id="buttons" runat="server" class="buttonContainer">
            <input id="Cancel" type="button" value="Annuleren" class="styledButton styledButton150" />
            <asp:Button ID="btnSave" runat="server" Text="Opslaan" CssClass="styledButton styledButton150"
                OnClick="btnSave_Click" />
        </div>
    </div>
</div>
<asp:PlaceHolder ID="phClose" runat="server" Visible="false">

    <script type="text/javascript">
        parent.workflow.openFrame.Close(true)
    </script>

</asp:PlaceHolder>

<script type="text/javascript">
    jQuery('#Cancel').click(function() {
        parent.workflow.openFrame.Close(true);
    });

    jQuery(document).ready(function() {
        workflow.form.radioButtonCtrl.SetupLabel();
        workflow.form.select.Init(".js_hiddenDropdown:not(.init)");
		jQuery("a.rcCalPopup").not(".rcDisabled").click(function(){
            setTimeout(function(){
                var docWidth = jQuery(document).width();
                var calWidth = jQuery(".RadCalendar_workflow").width();
                var leftOffset = (docWidth - calWidth)/2;
                jQuery(".RadCalendarPopup").css({
                    "left":leftOffset,
                    "top":"0"
                });            
            },50);
        });
        jQuery(".rcMainTable tbody td").click(function(){
            jQuery(".RadCalendarPopup").fadeOut("fast");
        });
    });

    function setMinDate() {
        var rdpEstimateEndDate = $find("<%= rdpEndDate.ClientID %>");
        var rdpEstimateStartDate = $find("<%= rdpStartDate.ClientID %>");

        var date = rdpEstimateStartDate.get_selectedDate();
        rdpEstimateEndDate.set_minDate(date);
    }
    
</script>



